package com.example.parkingproject.controller;

import com.example.parkingproject.entity.ParkingData;
import com.example.parkingproject.result.Result;
import com.example.parkingproject.service.ParkingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/parking")
@Slf4j
public class ParkingController {

    @Autowired
    private ParkingService parkingService;


    @GetMapping("/getParkingData")
    public Result getParkingData(){
        log.info("获取本月内停车信息");
        Result result = parkingService.getParkingData();
        return result;
    }

    @GetMapping("/getSevenDaysParkingData")
    public Result getSevenDaysParking(){
        log.info("获取七天内每天的停车信息");
        Result result = parkingService.getSevenDaysParkingData();
        return result;
    }

    @GetMapping("/getAllParkingDurationData")
    public Result getMonthParkingData(){
        log.info("获取所有的停车时长信息");
        Result result = parkingService.getMonthParkingDurationData();
        return result;
    }

}
